package com.campus_information_portal.dao;


import com.campus_information_portal.entity.Teacher;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;

/**
 * @author 20155883 万珊
 * @className TeacherDao
 * @Description 老师dao层
 * @create 2018-04-26 8:37
 **/
public interface TeacherDao {

    /**
     * @param te_num
     * @Description 根据Teacher表中的老师编号查询老师个人信息
     * @author 20155883 万珊
     * @methodName queryTeacherByTeNum
     * @returnType Teacher
     * @create 2018/4/26 8:45
     **/
    @Select("select * from teacher where te_num=#{te_num}")
    Teacher queryTeacherByTeNum(@Param("te_num") int te_num);


    /**
     * @param teacher
     * @Description 修改老师信息表（姓名，性别，身份证，出生年月，民族，电话，籍贯）
     * @author 20155883 万珊
     * @methodName 20155880 房雁颖
     * @returnType boolean
     * @create 2018/4/26 15:26
     **/
    @Update("update teacher set te_name=#{teacher.teName},te_sex=#{teacher.teSex},te_idcard_num=#{teacher.teIdcardNum},te_birthday=#{teacher.teBirthday},te_nation=#{teacher.teNation},te_phone=#{teacher.tePhone},te_nativeplace=#{teacher.teNativeplace} where te_num=#{teacher.teNum}")
    boolean updateTeacher(@Param("teacher") Teacher teacher);
     /**
          * @Description 通过老师名字查找id
          * @author 20155878 鄢前州
          * @methodName ququeryte_info_idByte_name
          * @returnType int
          * @create 9:09 2018/5/10
          **/
    @Select("select te_info_id  from teacher where te_name=#{te_name}")
    public int ququeryte_info_idByte_name(@Param("te_name") String te_name);
}
